package com.test.system.admin.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.test.system.admin.dao.BillDAO;
import com.test.system.admin.pojo.Bill;
import com.test.system.admin.service.BillService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 徒有琴
 */
@Service
public class BillServiceImpl implements BillService {
    @Autowired
    private BillDAO billDAO;

    @Override
    public PageInfo<Bill> getBillList(Bill bill, int pageNum, int pageSize) {
        //使用分页插件  页码，每页几条
        PageHelper.startPage(pageNum, pageSize);
        //PageHelper会对紧随其后的语句进行分页
        List<Bill> bills = billDAO.getBillList(bill);
        return new PageInfo<>(bills);
    }
}
